﻿Imports CustomTshirtFinal
Public Class ProductoNuevo
    Inherits System.Web.UI.Page
    Protected Sub btnGuardar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnGuardar.Click

        Try
            Dim negocio = New ProductoNegocio
            negocio.insertar(Me.txtNombre.Text, Me.txtDescripcion.Text, Me.txtPrecio.Text, Me.txtStock.Text, Me.txtImportancia.Text)

            Me.txtNombre.Text = ""
            Me.txtDescripcion.Text = ""
            Me.txtPrecio.Text = ""
            Me.txtStock.Text = ""
            Me.txtImportancia.Text = ""

            Response.Write("Se insertó correctamente")

        Catch ex As Exception
            Response.Write("Problemas al insertar")
        End Try

    End Sub

    Protected Sub btnRegresar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRegresar.Click
        Response.Redirect("Productos.aspx", True)
    End Sub
End Class